<template>
  <div class="header">
    <div class="header-nav">
      <router-link to="/home">
        <div class="iconfont header-back">&#xeb99;
        <p>城市选择</p>
        </div>
      </router-link>
    </div>
    
    <ul>
      <li v-for="(item,index) in list" :key="index" @click="add(item)">{{item.name}}</li>
      <!-- <li>{{item.province_id}}</li>yi -->
    </ul>
  </div>
</template>

<script>
import { Getpovr } from "../../../request/api";
export default {
  name: "CityHeader",
  data() {
    return {
      list: []
    };
  },
  methods: {
    add(val) {
      console.log(val)
      this.$router.push({ path: "/home", query: { nav: val,} });
    }
  },
  mounted() {
    let obj = {
      uid: 1
    };
    Getpovr(obj).then(res => {
      console.log(res);
      this.list = res.data.data;
    });
  }
};
</script>

<style scoped>
/* .iconfont{
  width:155px;
  height: 55px;
} */
.header-back{
  margin-top: 10px;
  width: 700px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.header-nav {
  display: flex;
  justify-content: space-around;
  height: 90px;
  border-bottom: 1px solid #666666;
}

.header-nav p {
  margin-right: 280px;
  color: #fff;
  line-height: 70px;
  font-size: 38px;
  text-align: center;
  
}
.header {
  height: 100%;
  background: #000;
}
.header ul {
  margin-left: 20px;
  /* border: 1px solid #fff; */
  display: flex;
  flex-direction: column;
  /* text-align: center; */
}
.header ul li {
  color: #fff;
  border-bottom: 1px solid #292929;
  font-size: 35px;
  width: 690px;
  height: 115px;
  line-height: 115px;
}
</style>